from django.urls import path
from rest_framework import routers
from .views import *

urlpatterns = [
    #获取讲师的排课信息
    path('usercourseplans', UserCoursePlanView.as_view({'get': 'getCoursePlan', 'put': 'adjustClassSection'})),
    #获取讲师的课表（点名表）
    path('point_name_tables',RollCallView.as_view({'get':'getPointNameTable'})),
    #根据教学周期计算讲师课时
    path('class_sections',RollCallView.as_view({'get':'getClassSections'})),
    #获取某一位老师的课时
    path('user_class_sections',RollCallView.as_view({'get':'getClassInfo'})),
    #获取不同类型的教学周期 全部的 有效的 生效的
    path('teaching_cycles',TeachingTimeView.as_view({'get':'getTeachingTime'})),
    path('class_attendances',RollCallView.as_view({'get':'getAttendance'})),
    #讲师撤销调代课时修改状态
    path('updatestate',AdjustClassTimeView.as_view({'get':'UpdateState'})),
    path('roll_sheet', RollCallView.as_view({'get': 'getRollSheet'})),
    path('getStudentName', RollCallView.as_view({'get': 'getStudentName'})),
    path('getTeachingCycleDateTime',TeachingTimeView.as_view({'get':'getTeachingCycleDateTime'})),
    path('get_coursetable',CoursePlanView.as_view({'get':'getCourseTable'}))
]
router = routers.DefaultRouter(trailing_slash=False)  # 取消url地址后面的 /
#生成教学周期增删改查操作url地址
router.register('teachingtimes', TeachingTimeView, basename='teachingtime')
#生成 课程体系
router.register('courses', CoursesView, basename='courses')
#排课
router.register('courseplans', CoursePlanView, basename='courseplans')
#调课
router.register('adjuct-classtimes', AdjustClassTimeView, basename='adjuct-classtimes')
#获取讲师的课表
router.register('class_timetables',RollCallView , basename='classtimetables')
#学院阶段
router.register('college_stages',CollegeStageView,basename='college_stages')
urlpatterns += router.urls
